#pragma once
#include "GameEngine.h"
#include <map>
#include <string>
using std::map;
using std::string;

class GameState
{
    friend class GameEngine;
    static map<string, GameState*> GameStates;    
    static GameState *ActiveState;
    static GameState *SwitchToState;
    static void Update();    
protected:
    map<string, string> m_Params;
public:
    static void Register(string name, GameState *gstate);
    static GameState * Find(string name);
    static void Switch(string name);
    static GameState* GetActiveState();

    void SetParam(string name, string value);
    string GetParam(string name);

    virtual void Initialize() = 0;
    virtual void Deinitialize() = 0;
    virtual void DoAction() = 0;
    virtual void OnDraw() = 0;
};